<div id="app">
  <button @click="isShow = !isShow">Toggle</button>
  <transition  name="slide">
    <p v-if="isShow">hello world</p>
  </transition>
  
</div>
<script src="https://unpkg.com/vue@next"></script>
<script>
  Vue.createApp({
    data() {
      return {
        isShow: true
      }
    }
  }).mount('#app')
</script>

<style>
.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

.fade-enter-active,
.fade-leave-active,
.slide-enter-active,
.slide-leave-active {
  transition: all .3s;
}



.slide-enter-from {
  opacity: 0;
  transform: translateX(-200px);
}
.slide-leave-to {
  opacity: 0;
  transform: translateX(200px);
}
</style>